import Vue from 'vue'
import Vuex from 'vuex'
import user from './modules/user'

import getters from './getters'
// 为了防止刷新后vuex store被清空引入的插件
import createPersistedState from "vuex-persistedstate"

Vue.use(Vuex)

const store = new Vuex.Store({
  modules: {
    user
  },
  getters,
  plugins: [createPersistedState({
    storage: window.sessionStorage
  })]
})

export default store
